//
//  YTNetworkManager.h
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/7/9.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "AFHTTPSessionManager.h"
#import "YTUserAccount.h"
//请求方式枚举
typedef NS_ENUM(NSInteger ,MethodHTTP){
    MethodGet,
    MethodPost
};

@interface YTNetworkManager : AFHTTPSessionManager


@property(nonatomic ,strong)YTUserAccount *account;

@property(nonatomic ,assign)int textSize;


// 实例化方法
+ (instancetype)shareManager;

/*
 封装上传数据的方法
 */
- (void)uploadWithUrlString:(NSString *)urlString
                       data:(NSData *)data name:(NSString *)name
                     params:(NSDictionary *)params
                 completion:(void(^)(id json, BOOL isSuccess))completion;

/**
 用一个函数网络封装请求GET、POST的方法
 
 @param method 请求方法 GET/POST
 @param urlStr url
 @param params 参数
 @param completion 完成回调
 */
- (void)requestWithMethod:(MethodHTTP)method
                UrlString:(NSString *)urlStr
                   params:(NSDictionary *)params
               completion:(void(^)(id json ,BOOL isSuccess))completion;


- (void)getAccessTokeWithCompletion:(void(^)(BOOL isSucc, NSString *error))completion;

#pragma mark: - 查询是否设置了代理
- (BOOL) checkProxySetting;
@end
